MessageArguments is the base class for arguments passed in messages.
More...
Inherits NativeObject.
Inherited by ActivityConceptMetadata.ActivityInternalMessageArguments, ActivityConceptMetadata.ActivityMessageArguments, ActivityConceptMetadata.ActivityPrefabMessageArguments, ActivityConceptMetadata.StartActivationInternalMessageArguments, ActivityConceptMetadata.StatusChangedInternalMessageArguments, ActivityHostConceptMetadata.ActivationMessageArguments, ActivityHostConceptMetadata.RegisterActivityElementInternalMessageArguments, ActivityHostConceptMetadata.UnregisterActivityElementInternalMessageArguments, ButtonConceptMetadata.CanceledMessageArguments, ButtonConceptMetadata.ClickedMessageArguments, ButtonConceptMetadata.LongPressMessageArguments, ButtonConceptMetadata.PointerEnteredMessageArguments, ButtonConceptMetadata.PointerLeftMessageArguments, ButtonConceptMetadata.PressedMessageArguments, ButtonConceptMetadata.ToggledOffMessageArguments, ButtonConceptMetadata.ToggledOnMessageArguments, ButtonConceptMetadata.ToggleStateChangedMessageArguments, CommandMetadata.CommandMessageArguments, ExclusiveActivityHostConceptMetadata.ImplicitActivityChangeRequestMessageArguments, FocusManagerMetadata.InputOutsideOverlayMessageArguments, FocusManagerMetadata.MoveFocusMessageArguments, FocusManagerMetadata.PostFocusMessageArguments, FocusManagerMetadata.ScopeStateChangeMessageArguments, InputManipulatorMetadata.InputMessageArguments, InputManipulatorMetadata.KeyInputMessageArguments, KeyboardMetadata.KeyStateChangedMessageArguments, ListBoxConceptMetadata.ItemMessageArguments, ListBoxConceptMetadata.ItemSelectedMessageArguments, ListBoxScrollingConceptMetadata.ScrollMessageArguments, NodeComponentMetadata.NodeComponentMessageArguments, NodeComponentMetadata.NodeComponentSourceMessageArguments, NodeMetadata.NodeComponentMessageArguments, NodeMetadata.NodeComponentSourceMessageArguments, PageMetadata.ActivatedMessageArguments, PageMetadata.DeactivatedMessageArguments, PageMetadata.NavigateMessageArguments, PageMetadata.NavigationActivatedMessageArguments, PageMetadata.NavigationDeactivatedMessageArguments, PageMetadata.NavigationFinishedMessageArguments, PageMetadata.NavigationStartedMessageArguments, PageMetadata.RegisterToNavigationdMessageArguments, PageMetadata.UnregisterFromNavigationMessageArguments, PrefabViewConceptMetadata.AsynchronousLoadCompletedMessageArguments, PrefabViewConceptMetadata.LoadAsynchronouslyMessageArguments, RangeConceptMetadata.CommonMessageArguments, ScreenMetadata.ActivateThemeMessageArguments, ScrollViewConceptMetadata.ScrollDirectionMessageArguments, ScrollViewConceptMetadata.ScrollDownMessageArguments, ScrollViewConceptMetadata.ScrollEdgeMessageArguments, ScrollViewConceptMetadata.ScrollEndMessageArguments, ScrollViewConceptMetadata.ScrollHomeMessageArguments, ScrollViewConceptMetadata.ScrollLeftMessageArguments, ScrollViewConceptMetadata.ScrollMessageArguments, ScrollViewConceptMetadata.ScrollPageDownMessageArguments, ScrollViewConceptMetadata.ScrollPageMessageArguments, ScrollViewConceptMetadata.ScrollPageUpMessageArguments, ScrollViewConceptMetadata.ScrollRightMessageArguments, ScrollViewConceptMetadata.ScrollUpMessageArguments, ScrollViewConceptMetadata.SetScrollMessageArguments, ScrollViewConceptMetadata.SetScrollTargetMessageArguments, ScrollViewConceptMetadata.SnapRequestMessageArguments, ScrollViewConceptMetadata.ZoomedMessageArguments, StateManagerMetadata.StateManagerMessageArguments, TextBoxConceptMetadata.CursorPositionMessageArguments, TextBoxConceptMetadata.EditingStateChangedMessageArguments, TextBoxConceptMetadata.InputMethodActionMessageArguments, TextBoxConceptMetadata.InputMethodAvailableMessageArguments, TextBoxConceptMetadata.TextChangedMessageArguments, TextBoxConceptMetadata.TextCompositionStateMessageArguments, TextBoxConceptMetadata.TextContentMessageArguments, TextBoxConceptMetadata.TextInsertionMessageArguments, TextBoxConceptMetadata.TextRangeMessageArguments, TextBoxMetadata.CharacterRemovalMessageArguments, TextBoxMetadata.CursorPositionMessageArguments, TextBoxMetadata.DeleteSelectionMessageArguments, TextBoxMetadata.EditingStateChangedMessageArguments, TextBoxMetadata.InputMethodActionMessageArguments, TextBoxMetadata.InputMethodAvailableMessageArguments, TextBoxMetadata.ModifyEditingStateMessageArguments, TextBoxMetadata.ModifySelectionMessageArguments, TextBoxMetadata.MoveCursorMessageArguments, TextBoxMetadata.TextChangedMessageArguments, TextBoxMetadata.TextCompositionStateMessageArguments, TextBoxMetadata.TextContentMessageArguments, TextBoxMetadata.TextInsertionMessageArguments, TextBoxMetadata.TextRangeMessageArguments, TextInputConceptMetadata.CursorMovedMessageArguments, TextInputConceptMetadata.InputMethodActionMessageArguments, TextInputConceptMetadata.InputMethodAvailableChangedMessageArguments, TextInputConceptMetadata.InputMethodsDisconnectedMessageArguments, TextInputConceptMetadata.InputTypeChangedMessageArguments, TextInputConceptMetadata.ReadOnlyStateChangedMessageArguments, TextInputConceptMetadata.SelectionChangedMessageArguments, TextInputConceptMetadata.TextChangedMessageArguments, TextInputConceptMetadata.TextCompositionStateMessageArguments, and ToggleButtonGroupConceptMetadata.ToggleButtonGroupConceptMessageArguments.
MessageArguments is the base class for arguments passed in messages.
An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.
You can derive your own custom message arguments type from this class or an existing derivation of this class, where you can define the property types associated to your message and any convenience functions like getters and setters. Make sure to expose proper constructors from your class, see constructors of this class for more information.
Constructs a new MessageArguments object.
When deriving a custom message arguments class, you will typically call this constructor from your main constructor.
Wraps a native message argument.
This constructor is used by Kanzi when delivering a message to a handler in Java.
When deriving a custom message arguments class, you will need to expose a constructor of matching signature, where you must simply forward the received argument to this constructor.
- Parameters
-
nativeObject | Reference to native message argument. |
TDataType getArgument |
( |
PropertyType< TDataType > |
propertyType | ) |
|
Returns the value of an argument.
- Parameters
-
propertyType | The PropertyType argument whose value to fetch. |
<TDataType> | Data type of the property, optional. |
- Returns
- The value of the argument. If the argument is not present in this message arguments instance, returns the default value of the PropertyType.
TDataType getOptionalArgument |
( |
PropertyType< TDataType > |
propertyType | ) |
|
Returns the value of an argument, but does not use the default value if there are no inputs to the argument value.
- Parameters
-
propertyType | The PropertyType argument whose value to fetch. |
<TDataType> | Data type of the property, optional. |
- Returns
- The value of the argument. If the argument is not present in this message arguments instance, returns null.
Returns the source node for a message.
- Parameters
-
<TNodeType> | The expected type of the node, optional. |
- Returns
- The source node where the message was dispatched.
MessageArgumentsWrapper getWrapper |
( |
| ) |
|
Returns whether the message is handled.
- Returns
- If the message is handled, true, otherwise false.
void setArgument |
( |
PropertyType< TDataType > |
propertyType, |
|
|
TDataType |
value |
|
) |
| |
Sets the value of an argument.
- Parameters
-
propertyType | The PropertyType argument whose value to set. |
value | The value to set for the argument. |
<TDataType> | Data type of the property, optional. |
void setArgument |
( |
PropertyType< Integer > |
propertyType, |
|
|
EnumType |
value |
|
) |
| |
Sets the value of an integer argument using a constant from an enumeration.
- Parameters
-
propertyType | The property type identifying the property to set. |
value | The enumeration constant to get the integer value from. |
- See also
- MessageArguments::setArgument(PropertyType, Object)
void setHandled |
( |
boolean |
handled | ) |
|
Sets the handling status for a message.
- Parameters
-
handled | The new handling status. |